#pragma once

#include "MBDataTypes.h"

/**
  *	An MBVec3 is a conventional vector with three elements. The data type of these
  * three elements is double.
  */
class MBVec3
{
public:
	MBVec3( void );
	MBVec3( const double *values );
	MBVec3( const double &v1, const double &v2, const double &v3 );

	MBVec3 Cross( const MBVec3 &other ) const;
	double Dot( const MBVec3 &other ) const;
	void Normalize( void );

	double &operator[]( const MBuint &index );
	const double &operator[]( const MBuint &index ) const;

	MBVec3 operator-( void ) const;
	MBVec3 operator-( const MBVec3 &other ) const;
	MBVec3 operator+( const MBVec3 &other ) const;
	MBVec3 operator*( const double &value ) const;
	MBVec3 operator/( const double &value ) const;

	static double Dot( const MBVec3 &first, const MBVec3 &second );
	static MBVec3 Cross( const MBVec3 &first, const MBVec3 &second );
	static MBVec3 Normalize( const MBVec3 &vec );

private:
	/** The three double values defining the 3D vector */
	double mValues[3];
};